﻿#ifndef IFRAMEWORK_H
#define IFRAMEWORK_H

#include "commdef.h"

class UI_Comm_Bridge
{
public:
    UI_Comm_Bridge()
    {
        data.clear();
        msgtype = 0;
    }
    quint16 msgtype;
    QString data; //json or string
};

typedef void(__stdcall *pfnUICommBridge)(UI_Comm_Bridge *pData, void *userdata);

class ILogger;
class INetComm;
class IConfig;
class ICommon;
class IService;
class IFramework : public QObject
{
public:
    IFramework() {}
    virtual ~IFramework() {}
    virtual int Init() = 0;
    virtual int UnInit() = 0;
    virtual int SetLogger(ILogger *pLogger) = 0;
    virtual int GetLogger(ILogger **ppLogger) = 0;
    virtual int GetCommon(ICommon **ppCommon) = 0;
    virtual int GetConfig(IConfig **ppConfig) = 0;
    virtual int GetSalesman(IService **ppSaleman) = 0;
    virtual int GetSaleswoman(IService **ppSalewoman) = 0;
    virtual int GetNetComm(INetComm **ppNetComm) = 0;
    virtual int SetCBUICommBridge(pfnUICommBridge pfn, void *pUserData) = 0;
    virtual int GetCBUICommBridge(pfnUICommBridge *ppfn, void **ppUserData) = 0;
};

#endif // IFRAMEWORK_H
